package com.trepadora.bean;

import java.io.IOException;

import com.trepadora.mapper.UserMapper;

/**
 * 
 * @author mkorwel
 * 
 */
public class RegisterBean {

	private String username;

	private String password;

	private String rePassword;

	private String email;

	private final UserMapper userMapper = new UserMapper();

	public String getEmail() {
		return this.email;
	}

	public String getPassword() {
		return this.password;
	}

	public String getRePassword() {
		return this.rePassword;
	}

	public String getUsername() {
		return this.username;
	}

	public String sendRegister() throws IOException {

		this.userMapper.saveUser(this.username, this.password, this.email);

		return "success";
	}

	public void setEmail(final String email) {
		this.email = email;
	}

	public void setPassword(final String password) {
		this.password = password;
	}

	public void setRePassword(final String rePassword) {
		this.rePassword = rePassword;
	}

	public void setUsername(final String username) {
		this.username = username;
	}
}
